@namespace BulmaRazor.Components
@inherits BulmaComponentBase

<ul id="@Id" @attributes="Attributes" class="@classes">
    <CascadingValue Value="this">
        @ChildContent
    </CascadingValue>
</ul>
@code{

    internal readonly string Id = "menulist_" + Guid.NewGuid().ToString("N");
    string classes => CssBuilder.Default("menu-list")
        .AddClassFromAttributes(Attributes)
        .Build();

    //这里设置是否手风琴

    
    /// <summary>
    /// 子内容
    /// </summary>
    [Parameter]
    public RenderFragment ChildContent { get; set; }

    /// <summary>
    /// 父Item
    /// </summary>
    [CascadingParameter]
    public MenuItem ItemParent { get; set; }

    
    /// <summary>
    /// 初始化
    /// </summary>
    protected override void OnInitialized()
    {
        if (ItemParent != null)
        {
            ItemParent.SubList = this;
        }
        base.OnInitialized();
    }
}